package cn.sytton.taffe.framework.xss;

import org.jsoup.Jsoup;
import org.jsoup.safety.Safelist;

import java.io.FileNotFoundException;
import java.io.IOException;

/**
 *
 */
public class JsoupUtil {

    public static String clean(String content) {
        return Jsoup.clean(content, Safelist.basic());
    }

    public static void main(String[] args) throws FileNotFoundException, IOException {
        String text = "<a href=\"http://www.baidu.com/a\" onclick=\"alert(1);\">sss</a><script>alert(0);</script>sss";
        System.out.println(clean(text));
    }

}
